<template>
  <div>
    <van-nav-bar title="城市列表" left-arrow />
    <van-index-bar v-for="(item, index) in cityList" :key="index">
      <van-index-anchor index="A" />
      <van-cell :title="item.label" />
    </van-index-bar>
  </div>
</template>

<script>
import { CityListApi } from "@/api";
export default {
  data() {
    return {
      cityList: [],
    };
  },
  mounted() {
    this.getCityList();
  },
  methods: {
    async getCityList() {
      try {
        const res = await CityListApi();
        this.cityList = res.data.body;
        console.log(res);
      } catch (e) {
        console.log(e);
      }
    },
  },
};
</script>

<style></style>
